package EX02_Account;

import java.util.Scanner;

public class AccountSVC implements IAccountSVC{

	private static IAccountDAO adao = null;

	
	public AccountSVC() {}
		  
	@Override
	public void createAccount() {
	
	Scanner sc = new Scanner(System.in);
	AccountVO avo = new AccountVO();
	
	
	System.out.println("계좌번호를 입력하세요");
	avo.setAid(sc.next());
	System.out.println("계좌잔액를 입력하세요");
	avo.setBalance(sc.next());
	System.out.println("이자율을 입력하세요");
	avo.setInterestRate(sc.next());
	
	if (adao.insertAccount(avo))
		System.out.println("계좌생성완료");
	else
		System.out.println("계좌생성실패");
	
	}

	@Override
	public void readAccount() {
		//for(AccountVO a : adao.()) {
			
		}
	

	@Override
	public void modifyAccount() {
		//read();
		AccountVO avo = new AccountVO();
		Scanner sc = new Scanner(System.in);
		System.out.println("수정할 계좌번호");
		avo.setAid(sc.next());
		System.out.println("수정할 통장잔액");
		avo.setBalance(sc.next());
		System.out.println("수정할 연간이자율");
		avo.setInterestRate(sc.next());
		if(adao.updateMember(avo))
			System.out.println("");
		else
			System.out.println("");
	}

	@Override
	public void removeAccount() {
		readAccount();
		AccountVO avo = new AccountVO();
		Scanner sc = new Scanner(System.in);
		System.out.println("");
	}

	@Override
	public float getMonthlyInterestRate() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void withdraw() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deposit() {
		// TODO Auto-generated method stub
		
	}
}
